<html>
<head>
    <title>Inventory</title>

    <script type="text/javascript" src="http://cdn.cancerregulome.org/js/extjs/3.4.0/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="http://cdn.cancerregulome.org/js/extjs/3.4.0/ext-all.js"></script>

    <script type="text/javascript" src="http://cdn.cancerregulome.org/js/protovis/3.3.1/protovis-r3.3.1.js"></script>
    <script type="text/javascript" src="http://cdn.cancerregulome.org/js/visquick/1.0.3/vq.min.js"></script>

    <script type="text/javascript" src="http://cdn.cancerregulome.org/js/re/1.0.8/namespace.js"></script>
    <script type="text/javascript" src="http://cdn.cancerregulome.org/js/re/1.0.8/overrides.js"></script>
    <script type="text/javascript" src="http://cdn.cancerregulome.org/js/re/1.0.8/utils.js"></script>

    <script type="text/javascript" src="js/association.js"></script>
    <script type="text/javascript" src="js/globals.js"></script>

    <script type="text/javascript">
        Ext.onReady(function() {
            var targetUrl = re.databases.base_uri + re.databases.rf_ace.uri + re.tables.dataset + "/query";
            Ext.Ajax.request({
                url: targetUrl,
                method: "GET",
                params: {
                    tqx: "out:json_array"
                },
                success: function(o) {
                    var data = Ext.util.JSON.decode(o.responseText);
                    if (data) {
                        var html = "";
                        var docHrf = document.location.href;
                        var rootUri = docHrf.substring(0, docHrf.indexOf("inventory.html"));
                        Ext.each(data, function(item) {
                            var url = rootUri + "?dataset=" + item.label;
                            html += "<li><a href='" + url + "' target='_blank'>" + item.label+ "</a>:" + item.description + "</li>";
                        });
                        Ext.getDom("c_container").innerHTML = "<ul>" + html + "</ul>"
                    }
                }
            })
        });
    </script>
</head>
<body>
<div id="c_container"></div>
</body>
</html>
